<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>员工管理</title>
    <#include "../common/link.ftl">
</head>

<body class="hold-transition skin-blue sidebar-mini">

<div class="wrapper">
    <#include "../common/navbar.ftl">
    <!--菜单回显&ndash;&gt;
    <#assign currentMenu="courseorder"/>
    <#include "../common/menu.ftl">
   <div class="content-wrapper">
        <section class="content-header">
            <h1>课程管理</h1>
        </section>
        <section class="content">
        <div class="box">
                <!--高级查询--->
            <div style="margin: 10px;">
                <!--高级查询--->
                <div style="margin: 10px;">
                    <form class="form-inline" id="searchForm" action="/courseorder/list.do" method="post">
                        <input type="hidden" name="currentPage" id="currentPage" value="1">
                        <div class="form-group">
                            <label for="keyword">关键字:</label>
                            <input type="text" class="form-control" id="keyword" name="keyword" value="${qo.keyword!}" placeholder="请输入姓名/邮箱">
                        </div>
                        <!--部门下拉框-->
                        <div class="form-group">
                            <label for="dept"> 课程:</label>
                            <select class="form-control" id="dept" name="deptId">
                                <option value="-1">全部</option>
                                <#list subjects! as sub>
                                    <!--通过部门id查询出部门的信息-->
                                    <option value="${sub.id}">${sub.title}</option>
                                </#list>
                            </select>
                            <!--下拉框回显-->
                            <script>
                                /* <#--  $("#dept option[value='${qo.deptId}']").prop("selected", true);-->*/
                                /*简写*/
                                $("#dept").val(${qo.deptId!});
                            </script>
                        </div>

                        <button id="btn_query" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span> 查询</button>
                        <a href="/courseorder/input.do" class="btn btn-success btn_redirect btn_input">
                            <span class="glyphicon glyphicon-plus"></span> 添加
                        </a>
                    </form>
                </div>
                <a href="/courseorder/input.do"
                   class="btn btn-info btn-xs btn-input"
                >
                    <span class="glyphicon glyphicon-pencil"></span> 添加
                </a>
                <table class="table table-hover table-bordered">
                        <tr>
                            <th>编号</th>
                            <th>销售时间</th>
                            <th>潜在客户</th>
                            <th>购买课程</th>
                            <th>销售金额</th>
                            <th>操作</th>
                        </tr>
                            <#list result.list as course>
                                  <tr>
                                      <!--freemarker 如果取值时是空值 会报错-->
                                      <td>${course_index+1}</td>
                                      <td>${(course.inputTime?string("yyyy-MM-dd"))!}</td>
                                      <td>${(course.customer.name)!}</td>
                                      <td>${(course.systemDictionaryItem.title)!}</td>
                                      <td>${course.money!}</td>
                                     <td>
                                          <!-- 使用data-*绑定自定义数据-->
                                          <a href="/courseorder/input.do?id=${course.id}"
                                             class="btn btn-info btn-xs btn-input"
                                              >
                                              <span class="glyphicon glyphicon-pencil"></span> 编辑
                                          </a>
                                              <a href="/courseorder/delete.do?id=${course.id}"
                                                 class="btn btn-danger btn-xs btn-delete"
                                                 >
                                                  <span class="glyphicon glyphicon-trash"></span> 删除
                                              </a>
                                      </td>
                                  </tr>
                            </#list>
                </table>
                <!--分页-->
                <#include "../common/page.ftl">
            </div>
        </section>
    </div>
    <#include "../common/footer.ftl">
</div>


<#--模态框-->
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">新增/编辑</h4>
            </div>
            <!--模态框内容-->
            <div class="modal-body">
                <form class="form-horizontal" action="/courseOrder/saveOrUpdate.do" method="post" id="editForm">
                    <input type="hidden" name="id">
                    <div class="form-group" style="margin-top: 10px;">
                        <label for="title" class="col-sm-3 control-label" >客户名称：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="customer" name="customer"
                                   placeholder="请输入客户名称">
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 10px;">
                        <label for="sn" class="col-sm-3 control-label">销售课程：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="subject" name="subject"
                                   placeholder="请输入销售课程">
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 10px;">
                        <label for="intro" class="col-sm-3 control-label">销售金额：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="money" name="money"
                                   placeholder="请输入销售金额">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary btn-submit">保存</button>
            </div>
        </div>
    </div>
</div>
    </section>
    </form>

</body>
</html>
